package com.wjx.demo.data

//数据类不能继承其他类 (但是可以实现接口)。
data class User(var name: String, var age: Int)

fun main(args: Array<String>) {
    var jack = User("zhangsan", 18)
    println(jack.toString())
    var (name, age) = jack
    println("name $name,age $age")

    var newjack = jack.copy(name = "lisi")//User(name=lisi, age=18)
    println(newjack.toString())
}

